package com.ityuxin.dao;

import com.ityuxin.domain.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Author: yyh
 * @Description:
 * @Date:Create：in 2021/4/3 16:05
 * @Modified By：
 */
public interface UserMapper {

    @Select("select *  from user")
    List<User> findAll();

    @Delete("delete from user where id = #{id} ")
    void deleteById(Integer id);


    @Insert("insert into user values(null,#{birthday},#{gender},#{username},#{password},#{remark},#{station},#{telephone}) ")
    void addserviceitem(User user);

    @Update("update user set birthday=#{birthday},gender=#{gender}，username=#{username}，password=#{password} ，remark=#{remark} ，station=#{station}，telephone=#{telephone} where id=#{id} ")
    void updateserviceitem(User user);


    @Select("select * from user where id = #{id} ")
    User findById(Integer id);


    @Select("select password from user where username = #{username}")
    String findPassword(String username);
}
